package repository

import "github.com/cheekybits/genny/generic"

// Player
//go:generate genny -in=repo_db_template.go -out=player.go gen "Object=model.Player ObjName=Player PackageName=model"
//go:generate genny -in=repo_db_template_test.go -out=player_test.go gen "Object=model.Player ObjName=Player PackageName=model"
// Puzzle
//go:generate genny -in=repo_db_template.go -out=puzzle.go gen "Object=model.Puzzle ObjName=Puzzle PackageName=model"
//go:generate genny -in=repo_db_template_test.go -out=puzzle_test.go gen "Object=model.Puzzle ObjName=Puzzle PackageName=model"
// CharacterData
//go:generate genny -in=repo_db_template.go -out=character_data.go gen "Object=model.CharacterData ObjName=CharacterData PackageName=model"
//go:generate genny -in=repo_db_template_test.go -out=character_data_test.go gen "Object=model.CharacterData ObjName=CharacterData PackageName=model"

// Object define the domain type (must has ID)
// This file contains template for generate db
// repository access code, it may have some error
// to compile (just ignore them).
type Object struct {
	generic.Type
	ID int
}

// ObjName define the name of domain type (move package name)
type ObjName generic.Type

// mockPackage defines field and method to mock a generic package
type mockPackage struct{}

func (p mockPackage) NewObjName() *Object { return &Object{} }

// PackageName define the package where defines ObjName
// where has NewObjName interface
var PackageName = mockPackage{}
